package com.wisnews.controller.sr;


import com.wisnews.pojo.Result;
import com.wisnews.pojo.sr.entity.Hobby;
import com.wisnews.service.sr.Impl.HobbyServiceImpl;
import com.wisnews.util.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yuyd
 * @since 2021-01-15
 */
@RestController
@RequestMapping("/hobby")
public class HobbyController {

    @Autowired
    private HobbyServiceImpl hobbyService;

    /**
     * @description: 获取爱好列表
     * @param:
     * @return:
     * @author yuyd
     * @date: 2021/5/2 22:16
     */
    @RequestMapping(value = "list",method = RequestMethod.POST)
    public Result getAllHobby() {

        List<Hobby> lists = hobbyService.list();

        return new Result(Constants.SYS_CODE.SUCCESS, Constants.SYS_CODE.SUCCESS_MESSAGE,lists);
    }
}
